<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title><?php echo ViewUtil::retrieveCopLabel(); ?></title>
		
		<!-- JQuery -->
	    <script type="text/javascript" src="../../js/jquery/jquery.js"></script>
	    
	    <!-- Style sheets -->
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/common.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/forms.css" />
	    <link rel="stylesheet" type="text/css" href="../../views/<?php echo $GLOBALS['dir_theme']; ?>css/admin.css" />
		<?php include dirname(__FILE__) . "/../${GLOBALS['dir_theme']}partials/x-browser.tpl"; ?>
	
		<script type="text/javascript">
		/* add an hover effect for the widget divs */
		$(document).ready(function(){
			
			/* div mouseover effects */
			$('.widget').mouseover( function(){
				$(this).addClass('hover');
			}); 
			
			/* div mouseout effects */
			$('.widget').mouseout( function(){
				$(this).removeClass('hover');
			});
			
			/* div mark effects */
			$('.widget').click( function(){
				$('.widget').removeClass('marked');
				$(this).addClass('marked');
			});
			
			/* authentication controls */
			$('a.authenticationOption').click(function(){
				$('div.container').hide("slow");
				$('#authenticationContainer_'+this.id.substr(2)).show("slow");
			});
			
			/* authentication form cancel buttons */
			$('div.authentication input[@type=reset]').click(function(){
				$('div.authentication').hide("slow");
			});
			
			/* visibility controls */
			$('a.visibleOption').click(function(){
				$('div.container').hide("slow");
				$('#visibilityContainer_'+this.id.substr(2)).show("slow");
			});
			
			/* visibility form cancel buttons */
			$('div.visibility input[@type=reset]').click(function(){
				$('div.visibility').hide("slow");
			});
			
			/* edit controls */
			$('a.editOption').click(function(){
				$('div.container').hide("slow");
				$('#editContainer_'+this.id.substr(2)).show("slow");
			});
			
			/* edit form cancel buttons */
			$('div.edit input[@type=reset]').click(function(){
				$('div.edit').hide("slow");
			});
			
			/* delete controls */
			$('a.deleteOption').click(function(){
				$('div.container').hide("slow");
				$('#deleteContainer_'+this.id.substr(2)).show("slow");
			});
			
			/* delete form cancel buttons */
			$('div.delete input[@type=reset]').click(function(){
				$('div.delete').hide("slow");
			});
			
			/* integrate controls */
			$('a.integrate').click(function(){
				$('div.container').hide("slow");
				$('#integrateContainer_'+this.id.substr(2)).show("slow");
			});
			
			/* subscribe controls */
			$('a.subscribe').click(function(){
				$('div.container').hide("slow");
				$('#subscribeContainer_'+this.id.substr(2)).show("slow");
			});
		});
	
	</script>
	</head>

	<body>
		<div id="header">
			<?php if ($copName = ViewUtil::retrieveCopName()): ?>
			<div id="organization_name"><?php echo $copName; ?></div>
			<?php endif; ?>
			<img id="logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/logo.png"/>
			<a id="header_action" href="../../index.php/wall/index"><?php echo __("Back to the portal"); ?></a>
			<div id="control">
				<ul id="user_info">
					<li><?php echo Auth::getUserName();?></li>
				</ul>
				
				<ul>
					<?php if ($widgetManagement) : ?>
					<li><a id="administration" href="../../index.php/admin/index"><?php echo __("Administration"); ?></a></li>
					<?php endif; ?>
					<li><a id="preferences" href="../../index.php/users/preferences"><?php echo __("My preferences"); ?></a></li>
					<li><a id="help" href="../../index.php/help/index"><?php echo __("Online help"); ?></a></li>
				</ul>
				
				<ul>
					<li><a id="logout" href="../../index.php/users/logout"><?php echo __('Logout'); ?></a></li>
				</ul>
			</div>
		</div>
		<div id="content">
			<div id="menu_content">
				<ul id="menu">
					<li><a id="menu_widgets" href="../../index.php/admin/index"><?php echo __("Widgets"); ?></a></li>
					<li><a id="menu_categories" href="../../index.php/adminCategories/index"><?php echo __("Categories"); ?></a></li>
					<li><a id="menu_users" href="../../index.php/adminUsers/index"><?php echo __("Users"); ?></a></li>
					<li><a id="menu_misc" href="../../index.php/adminMisc/index"><?php echo __("Miscellaneous"); ?></a></li>
				</ul>
			</div>
			
			<div id="admin">
				<?php if (isset($message) && !$isError): ?>
					<div id='message'><?php echo $message; ?></div>
				<?php elseif (isset($message) && $isError): ?>
					<div id='error'><?php echo $message; ?></div>
				<?php endif;?>
			
				<div id="admin_content">
					<?php include dirname(__FILE__). '/partials/admin_' . $partial . '.tpl'; ?>
				</div>
			</div>
		</div>
		
		<div id="footer">
			<a href="http://europa.eu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-eu.png" alt="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>" title="<?php echo __("PALETTE is an Integrated Project supported by the IST programme of the European Commission"); ?>"/></a>
			<a href="http://www.tudor.lu"><img class="footer_logo" src="../../views/<?php echo $GLOBALS['dir_theme']; ?>img/footer-tudor.png" alt="<?php echo __("Public Research Center Henri Tudor"); ?>" title="<?php echo __("Centre de Recherche Public Henri Tudor"); ?>"/></a>
			<p>
				<?php echo sprintf(__("Copyright %s-%s Public Research Center Henri Tudor."), '2007', '2009'); ?>
			</p>
		</div>
	</body>
</html>
